Skip to content

feat(fastify)!: Support Fastify v5 - #4270

Merged
LekoArts merged 22 commits into
mainfrom
lekoarts/eco-204-support-fastify-v5
Oct 8, 2024
Merged

feat(fastify)!: Support Fastify v5#4270
LekoArts merged 22 commits into
mainfrom
lekoarts/eco-204-support-fastify-v5

Conversation

@LekoArts

@LekoArts LekoArts commented Oct 2, 2024

Copy link
Copy Markdown
Contributor

Description

This PR will trigger a new major release for @clerk/fastify. The reason is that Fastify v5 isn't backwards compatible with our current plugin as we allow Node.js 18 and they now require Node 20. So we need to bump our engines.

Therefore the new major version of @clerk/fastify will only support Fastify v5, users of older versions need to stick with the current major version.

Fixes #4229

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Oct 2, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bf3208c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/fastify Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LekoArts

LekoArts commented Oct 2, 2024

Copy link
Copy Markdown
Contributor Author

!allow-major

@LekoArts LekoArts changed the title feat!(fastify): Support Fastify v5 feat(fastify)!: Support Fastify v5 Oct 2, 2024
Comment thread .changeset/wise-onions-double.md Outdated
@LekoArts LekoArts mentioned this pull request Oct 4, 2024
9 tasks
@LekoArts
LekoArts marked this pull request as ready for review October 4, 2024 13:35
@brkalow

brkalow commented Oct 4, 2024

Copy link
Copy Markdown
Member

@LekoArts do we also want to update the root fastify dependency? https://github.com/clerk/javascript/blob/main/package.json#L83

(or maybe we can remove it altogether)

@LekoArts

LekoArts commented Oct 7, 2024

Copy link
Copy Markdown
Contributor Author

@brkalow Good catch! That's not needed at the root since I've put it into the plugin. Weird that it was there in the first place

@brkalow brkalow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! One question about changes to the playground dependencies

Comment on lines -9 to -12
"@clerk/backend": "file:.yalc/@clerk/backend",
"@clerk/fastify": "file:.yalc/@clerk/fastify",
"@clerk/shared": "file:.yalc/@clerk/shared",
"@clerk/types": "file:.yalc/@clerk/types",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we retain yalc usage here for the playground?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it because when you use clerk-dev-cli or secco it gets in the way. If we want to dogfood the dev CLI we need to remove yalc ;)

@LekoArts
LekoArts enabled auto-merge (squash) October 8, 2024 13:16
@LekoArts
LekoArts merged commit bd92d38 into main Oct 8, 2024
@LekoArts
LekoArts deleted the lekoarts/eco-204-support-fastify-v5 branch October 8, 2024 13:43
@jvelezpo

jvelezpo commented Oct 9, 2024

Copy link
Copy Markdown

Hello! 👋
@LekoArts i installed latest version using fastify v5
and i get the following error

FastifyError [Error]: fastify-plugin: @clerk/fastify - expected '4.x' fastify version, '5.0.0' is installed
    at Object.checkVersion (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/fastify/lib/pluginUtils.js:125:11)
    at Object.registerPlugin (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/fastify/lib/pluginUtils.js:148:16)
    at Boot.override (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/fastify/lib/pluginOverride.js:28:57)
    at Boot._loadPlugin (/Users/sebastian/Desktop/TEMP/secure/fast/node_modules/avvio/boot.js:425:25)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'FST_ERR_PLUGIN_VERSION_MISMATCH',
  statusCode: 500
}

Steps to reproduce the issue
run
npm install @clerk/fastify
version installed
"version": "1.0.51"

Maybe the CI did not picked up the latest changes and build the new package with the old code 🤔

Please let me know if i can help or submit a PR i would appreciate a little bit of guidance for it

Thanks.

@wobsoriano

wobsoriano commented Oct 9, 2024

Copy link
Copy Markdown
Member

@jvelezpo we did not publish this update to NPM yet. Maybe tomorrow.

For now, you can try the canary version

npm install @clerk/fastify@2.0.0-canary.v34b47d1

@LekoArts

LekoArts commented Oct 9, 2024

Copy link
Copy Markdown
Contributor Author

@jvelezpo Once #4307 is merged it'll be released 👍

@jvelezpo

jvelezpo commented Oct 9, 2024

Copy link
Copy Markdown

Amazing
Thanks

@LekoArts

LekoArts commented Oct 11, 2024

Copy link
Copy Markdown
Contributor Author

@jvelezpo That PR has been released, you can upgrade now with npm install @clerk/fastify@latest

wobsoriano pushed a commit that referenced this pull request Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Fastify v5

5 participants